Engineering Java 7's Dual Pivot Quicksort Using MaLiJan
نویسندگان
چکیده
Recent results on Java 7’s dual pivot Quicksort have revealedits highly asymmetric nature. These insights suggest that asymmetric pivot choices are preferable to symmetric onesfor this Quicksort variant. From a theoretical point of view,this should allow us to improve on the current implementa-tion in Oracle’s Java 7 runtime library. In this paper, weuse our new tool MaLiJAn to confirm this asymptoticallyfor combinatorial cost measures such as the total number of executed instructions. However, the observed running timesshow converse behavior. With the support of data providedby MaLiJAn we are able to identify the profiling capabilitiesof Oracle’s just-in-time compiler to be responsible for thisunexpected outcome.
منابع مشابه
Pivot Sampling in Java 7's Dual-Pivot Quicksort
The new dual-pivot Quicksort by Vladimir Yaroslavskiy — used in Oracle’s Java runtime library since version 7 — features intriguing asymmetries in its behavior. They were shown to cause a basic variant of this algorithm to use less comparisons than classic single-pivot Quicksort implementations. In this paper, we extend the analysis to the case where the two pivots are chosen as fixed order sta...
متن کاملPivot Sampling in Dual-Pivot Quicksort
The new dual-pivot Quicksort by Vladimir Yaroslavskiy — used in Oracle’s Java runtime library since version 7 — features intriguing asymmetries in its behavior. They were shown to cause a basic variant of this algorithm to use less comparisons than classic single-pivot Quicksort implementations. In this paper, we extend the analysis to the case where the two pivots are chosen as fixed order sta...
متن کاملAverage Case and Distributional Analysis of Java 7's Dual Pivot Quicksort
In 2009, Oracle replaced the long-serving sorting algorithm in its Java 7 runtime library by a new dual pivot Quicksort variant due to Yaroslavskiy. The decision was based on the strikingly good performance of Yaroslavskiy’s implementation in running time experiments. At that time, no precise investigations of the algorithm were available to explain its superior performance — on the contrary: P...
متن کاملAverage Case Analysis of Java 7's Dual Pivot Quicksort
Recently, a new Quicksort variant due to Yaroslavskiy was chosen as standard sorting method for Oracle’s Java 7 runtime library. The decision for the change was based on empirical studies showing that on average, the new algorithm is faster than the formerly used classic Quicksort. Surprisingly, the improvement was achieved by using a dual pivot approach, an idea that was considered not promisi...
متن کاملWhy Is Dual-Pivot Quicksort Fast?
I discuss the new dual-pivot Quicksort that is nowadays used to sort arrays of primitive types in Java. I sketch theoretical analyses of this algorithm that offer a possible, and in my opinion plausible, explanation why (a) dual-pivot Quicksort is faster than the previously used (classic) Quicksort and (b) why this improvement was not already found much earlier.
متن کامل